		
/* ************************************************************************************* 
 * CREATED BY:          MYGENERATION
 * CREATED DATE:        12/26/2008
 * PROJECT:             MCWEBSITE
 * PURPOSE:             websiteStaticContentBUL class
 * MODIFIED BY:         None
 * MODIFIED DATE:       None
 * MODIFIED REASON:     None
 * NOTES:               None
 **************************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using MCWEBSITE.DAL;
using MCWEBSITE.ENTITY;

namespace MCWEBSITE.BUL
{
    public class websiteStaticContentBUL
    {
        public static int Save(websiteStaticContentInfo _websiteStaticContentInfo)
        {
            try
            {
                if (_websiteStaticContentInfo.SataticContentID == 0)
                {
                    return websiteStaticContentDAL.Insert(_websiteStaticContentInfo);
                }
                else
                {
                    return websiteStaticContentDAL.Update(_websiteStaticContentInfo);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on insert theme : {0}", ex.Message));
            }
        }

        public static int Remove(int _SataticContentID)
        {
            try
            {
                return websiteStaticContentDAL.Delete(_SataticContentID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on delete Theme : {0}", ex.Message));
            }
        }

        public static List<websiteStaticContentInfo> GetAll()
        {
            try
            {
                return websiteStaticContentDAL.SelectAll();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static websiteStaticContentInfo Load(int _SataticContentID)
        {
            try
            {
                return websiteStaticContentDAL.SelectOne(_SataticContentID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static websiteStaticContentInfo GetByCode(string _SataticContentCode)
        {
            try
            {
                return websiteStaticContentDAL.SelectByCode(_SataticContentCode);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static websiteStaticContentInfo GetByLanguageAndCode(string Language,string code)
        {
            try
            {
                return websiteStaticContentDAL.SelectByLanguageAndCode(Language, code);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static List<websiteStaticContentInfo> Search()
        {
            try
            {
                return websiteStaticContentDAL.SelectFilters();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

    }
}

		